#ifndef __VENC_H_
#define __VENC_H_

#include "rk_mpi.h"

typedef struct Venc_EsPacket_s
{
    void *data;
    int len;
    void *priv;
} Venc_EsPacket_t;

typedef struct Venc_Config_s
{
    int width;
    int height;
    int fmt;
    int rc_mode;
    int buf_num;
} Venc_Config_t;

typedef struct Venc_Device_s
{
    int width;
    int height;
    int fmt;
    int buf_num;
    MppBuffer pkg_buf;
    MppBuffer frame_buf[];
} Venc_Device_t;

Venc_Device_t *Venc_Init(Venc_Config_t *cfg);
void Venc_Deinit(Venc_Device_t *device);
void Venc_TransformDmaBufToMppBuf(int fd, MppBuffer *pbuf, int buf_len);
int Venc_EnqueueBuf(Venc_Device_t *device, int index);
int Venc_DequeueBuf(Venc_Device_t *device);
int Venc_GetEsBuf(Venc_Device_t *device, Venc_EsPacket_t *Packet);
int Venc_PutEsBuf(Venc_Device_t *device, Venc_EsPacket_t *Packet);

#endif
